<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<!-- saved from url=(0046)http://uva.onlinejudge.org/external/4/455.html -->
<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>Periodic Strings</TITLE>
<META name="description" content="Periodic Strings">
<META name="keywords" content="htmlatex">
<META name="resource-type" content="document">
<META name="distribution" content="global">
<LINK rel="STYLESHEET" href="http://uva.onlinejudge.org/external/4/htmlatex.css">
</HEAD><BODY lang="EN" bgcolor="#FFFFFF">
 <CENTER><TABLE bgcolor="#0060F0"><TBODY><TR><TD><B><FONT size="5" color="#C0FFFF">&nbsp;<A name="SECTION0001000000000000000000">Periodic Strings</A></FONT>&nbsp;</B></TD></TR></TBODY></TABLE></CENTER>
<P>
   A character string is said to have period <I>k</I> if it can be formed by concatenating one or more repetitions of another string of length <I>k</I>. For example,
the string "<TT>abcabcabcabc</TT>" has period 3, since it is formed by 4 repetitions of the string "<TT>abc</TT>". It also has periods 6 (two repetitions of "<TT>abcabc</TT>") and 12 (one repetition of "<TT>abcabcabcabc</TT>").
</P><P>
</P><P>
   Write a program to read a character string and determine its smallest
period.
</P><P>
</P><H2><FONT color="#0070E8"><A name="SECTION0001001000000000000000">Input</A></FONT></H2>
 <P>The first line oif the input file will contain a single integer N indicating
 how many test case that your program will test followed by a blank line. Each test case will contain a single character string of up to 80 non-blank characters.
 Two consecutive input will separated by a blank line.
</P><P>
</P><H2><FONT color="#0070E8"><A name="SECTION0001002000000000000000">Output</A></FONT></H2>
<P>
An integer denoting the smallest period of the input string for each input. Two
consecutive output are separated by a blank line.
</P><P>
</P><H2><FONT color="#0070E8"><A name="SECTION0001003000000000000000">Sample Input</A></FONT></H2>
<P>
</P><PRE>1

HoHoHo</PRE>
<H2><FONT color="#0070E8"><A name="SECTION0001004000000000000000">Sample Output</A></FONT></H2>
<PRE>2</PRE>
<P>


</P></BODY></HTML>